
# string spilt function 

print "spilt the string according to commas \n";

my $data = 'sravan ,k,reddy ,23,male,hyderabad';

  my @values = split(',', $data);

  foreach my $val (@values) {
    print "$val\n";
  }

 
  
 #If you split on an undefined value, the string will be split on every character:

print "spillting the string on every character \n";


my $data = 'cm punck and undertaker wwe';

  my @values = split(undef,$data);

  foreach my $val (@values) {
    print "$val\n";
  }

  
exit 0;





